<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUserTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('user', function (Blueprint $table) {
            $table->increments('id');
            $table->string('phone',150)->comment('手机号码');
            $table->string('nickname',150)->comment('昵称');
            $table->string('password',255)->comment('密码');
            $table->string('avatar',255)->nullable()->comment('个人头像');
            $table->enum('gender',['0','1','2'])->nullable()->default('0')->comment('性别');
            $table->decimal('amount',8,2)->nullable()->default('0.00')->comment('余额');
            $table->string('openid',150)->comment('微信授权的OPENID');
            
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('user');
    }
}
